/******************************init****************************/
function saveCategory() {
	var url = create_url('category-save');
	var parm = $('#editCategoryForm').serialize();
	sys_record_parm('category',parm);
	$.ajax({type:'POST', url:url, data:parm,
	 	success:function(result) {
			if (result == 'success') {
				sys_msg('操作成功!');
				sys_load_handle('category');
			} else {
				sys_msg('操作失败!!');
			}
		}
	});
}

function selectCategory() {
	var url = create_url('category-aidInit');
	var parm = {'id':'pc', 'name':'pn'};
	$.colorbox({overlayClose:false, href:url, data:parm, close:'[关闭]', width:'400px', height:'600px', open:true});
}

function clearForm() {
	$(':input','#editCategoryForm')  
	 .not(':button, :submit, :reset')  
	 .val('')  
	 .removeAttr('checked')  
	 .removeAttr('selected');
	 
	 $('#pc').val('0');
	 $('#pn').val('0');
}
function checkedCategory(){
	var name = $("#name").val();
	if(name.length == 0){
		sys_msg('请输入类型名称');
		return
	}
	saveCategory();
}
/************aidinit******************/

